﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="PurInvoiceWithBillLevel.aspx.cs"
    Inherits="Main_Inventory_PurInvoiceWithBillLevel" Culture="en-GB" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="AjaxControl" %>
<%@ Register Src="~/User Controls/PageHeading.ascx" TagName="heading" TagPrefix="acc" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Purchased Received</title>
    <link rel="Stylesheet" href="../../Styles/accounts.css" type="text/css" />
    <link href="../../Styles/ComboBox.css" rel="stylesheet" type="text/css" />
    <%--<script src="../../Menu/js/jquery.min.js" type="text/javascript"></script>--%>
    <script src="../../JavaScript/jquery-1.4.2.min.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript">
        function isNumberKey(control_id, evt) {
            var charCode = (evt.which) ? evt.which : event.keyCode
            if (charCode > 31 && (charCode < 48 || charCode > 57) && (charCode < 45 || charCode > 47))
                return false;

            if (charCode == 46) {
                var dotcount = document.getElementById(control_id).value.split('.').length - 1;
                if (dotcount >= 1) {
                    return false;
                }
            }
            return true;
        }

        function CalculateAmount() {
            var TotalQty = 0;
            var TotalGrossAmt = 0;
            var TotalTaxAmount = 0;
            var GrandTotal = 0;
            var count = document.getElementById("hidControlTblItems").value;
            var taxRate = document.getElementById("hidTaxRate").value;
            //****************for loop to find control in table rows*****
            for (var i = 1; i <= count; i++) {
                var orderQty = document.getElementById("hidOrderQty" + i).value;
                var hidPoRate = document.getElementById("hidPoRate" + i).value;
                var receivedQty = document.getElementById("txtReceivedQty" + i).value;
                var txtAmtRate = document.getElementById("txtRate" + i).value;

                if (receivedQty != '' && parseFloat(receivedQty) > 0)//check quantity is not null & greater than 0
                {
                    if (parseFloat(receivedQty) > parseFloat(orderQty))//check if received qty is not more than order qty
                    {
                        alert('Received Quantity can not more than Order Quantity (' + parseFloat(orderQty).toFixed(2) + ')');
                        receivedQty = parseFloat(orderQty);
                        document.getElementById("txtReceivedQty" + i).value = parseFloat(orderQty).toFixed(2);
                    }

                    if (txtAmtRate != '' && parseFloat(txtAmtRate) > 0)//check amount payable is not null & greater than 0
                    {
                        if (parseFloat(parseFloat(txtAmtRate).toFixed(2)) > parseFloat(parseFloat(hidPoRate).toFixed(2))) {
                            alert('Received Item Rate can not Greater Than Ordered Item rate, Ordered Item Rate = ' + parseFloat(hidPoRate).toFixed(2) + ' & Received Item Rate = ' + parseFloat(txtAmtRate).toFixed(2));
                            txtAmtRate = parseFloat('0');
                            document.getElementById("txtRate" + i).value = txtAmtRate;
                        }

                        var grossAmt = 0;
                        var taxAmount = 0;
                        var amountPayable = 0;
                        var grossAmt = parseFloat(receivedQty) * parseFloat(txtAmtRate);
                        if (taxRate != '' && parseFloat(taxRate) > 0) {
                            taxAmount = parseFloat(grossAmt) * parseFloat(taxRate) / 100;
                        }
                        else {
                            taxAmount = 0;
                        }
                        document.getElementById("hidTaxAmt" + i).value = taxAmount.toFixed(2);
                        amountPayable = parseFloat(taxAmount) + parseFloat(grossAmt);
                        document.getElementById("txtGrossAmt" + i).value = parseFloat(grossAmt).toFixed(2);
                        document.getElementById("txtRate" + i).value = parseFloat(txtAmtRate).toFixed(2);
                        document.getElementById("txtAmountPayable" + i).value = parseFloat(amountPayable).toFixed(2);
                        TotalGrossAmt += parseFloat(grossAmt);
                        TotalTaxAmount += parseFloat(taxAmount);
                    }
                    else {
                        document.getElementById("txtAmountPayable" + i).value = '';
                        document.getElementById("txtRate" + i).value = '0.00';
                        document.getElementById("txtGrossAmt" + i).value = '';

                    } //  
                    document.getElementById("txtReceivedQty" + i).value = parseFloat(receivedQty).toFixed(2);
                    TotalQty += parseFloat(receivedQty);
                }
                else {
                    document.getElementById("txtReceivedQty" + i).value = '0.00';
                    document.getElementById("txtAmountPayable" + i).value = '';
                    document.getElementById("txtGrossAmt" + i).value = '';

                } //end checking quantity                 
                if (txtAmtRate == '')//check if textbox is null 
                {
                    document.getElementById("txtRate" + i).value = '0.00';
                }
            } //End for loop            
            //assign total value to final textboxs
            document.getElementById("txtTotalQuantity").value = parseFloat(TotalQty).toFixed(2);
            document.getElementById("txtGrossAmount").value = parseFloat(TotalGrossAmt).toFixed(2);
            document.getElementById("txtTaxableAmt").value = parseFloat(TotalGrossAmt).toFixed(2);
            document.getElementById("txtVat").value = parseFloat(TotalTaxAmount).toFixed(2);
            GrandTotal = parseFloat(TotalGrossAmt) + parseFloat(TotalTaxAmount);
            document.getElementById("txtPostTaxTotal").value = parseFloat(GrandTotal).toFixed(2);
            var roundOff = document.getElementById("txtRoundoff").value;
            var NetGrantTotal = 0;
            if (parseFloat(GrandTotal) > parseFloat(roundOff)) {
                NetGrantTotal = parseFloat(GrandTotal) + parseFloat(roundOff);
            }
            else {
                NetGrantTotal = parseFloat(GrandTotal);
                document.getElementById("txtRoundoff").value = '0.00';
            }
            document.getElementById("txtGrandTotal").value = parseFloat(NetGrantTotal).toFixed(2);

        }


        function GetQuantity(hidItemId, CtrlId, OrderQty, HidLocationId) {
            var ctrlIndex = HidLocationId.toString();
            var LocationIdandQty = document.getElementById(ctrlIndex).value;
            window.open('WinPurchaseQty.aspx?ItemId=' + hidItemId + '&CtrlId=' + CtrlId + '&OrderQty=' + OrderQty + '&HidLocationId=' + HidLocationId + '&LocationIdandQty=' + LocationIdandQty, 'Quantity', 'width=700, height=400, resizable=0');
            //window.open("WinPurchaseQty.aspx?ItemId=" + hidItemId + "&CtrlId=" + CtrlId + "&OrderQty=" + OrderQty + "&HidLocationId=" + HidLocationId + "&LocationIdandQty=" + LocationIdandQty, "Quantity", "width=700, height=400, resizable=0");
        }
        function SetZero(id) {
            var control = document.getElementById(id);
            if (control.value == '') {
                control.value = '0.00';
            }
            else {
                control.value = parseFloat(control.value).toFixed(2);
            }
        }
        function RemoveZero(id) {
            var control = document.getElementById(id);
            if (control.value == '0.00') {
                control.value = '';
            }
        }
        function roundOff(id) {
            var totalAmt = 0;
            var postTax = document.getElementById("txtPostTaxTotal").value;
            var roundOff = document.getElementById(id).value;
            if (parseFloat(postTax) > parseFloat(roundOff)) {
                totalAmt = parseFloat(postTax) + parseFloat(roundOff);
                document.getElementById("txtGrandTotal").value = parseFloat(totalAmt).toFixed(2);
                document.getElementById(id).value = parseFloat(roundOff).toFixed(2);
            }
            else {
                document.getElementById(id).value = '0.00';
                document.getElementById("txtGrandTotal").value = parseFloat(postTax).toFixed(2);
            }
        }
        function CatchTab(myfield, e)//disable keydown event of textbox not TAB key
        {
            var keycode;
            if (window.event) {
                keycode = window.event.keyCode;
            }
            else if (e) {
                keycode = e.which;
            }
            else {
                return true;
            }

            if (keycode == 9) {
                // if is the tab key                
                return true;
            }
            else {
                return false;
            }
        }
        function DisableRightClick(event) {   //For mouse right click 
            if (event.button == 2) {
                return false
            }
        }

        function ErrorMessage(msg) {
            alert(msg);
            return false;
        }

        function OpenWindow(poid) {
            window.open('PODetails.aspx?Poid=' + poid, '', 'width=800,height=600,toolbar=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
        }
        function checkTaxGroup(id) {
            var ddl = document.getElementById(id);
            if (ddl.length == 0) {
                alert('select Tax Group');
                document.getElementById("ddlTaxGroup").focus();
            }
        }
    </script>
    <style type="text/css">
        #wrapper
        {
            width: 110%;
            margin-left: 5%;
            margin-top: 15px;
        }
        ul.tabs
        {
            width: 99%;
            margin: 0;
            padding: 0;
        }
        ul.tabs li
        {
            display: block;
            float: left;
            padding: 0 5px;
        }
        ul.tabs li a
        {
            display: block;
            float: left;
            padding: 5px;
            font-size: 0.8em;
            background-color: #e0e0e0;
            color: #666;
            text-decoration: none;
        }
        .selected
        {
            font-weight: bold;
        }
        .tab-content
        {
            clear: both;
            border: 1px solid #ddd;
            padding: 10px;
        }
    </style>
    <script type="text/javascript">

        $(document).ready(function () {

            $('.tabs a').click(function () {
                switch_tabs($(this));
            });

            switch_tabs($('.defaulttab'));

        });

        function switch_tabs(obj) {
            $('.tab-content').hide();
            $('.tabs a').removeClass("selected");
            var id = obj.attr("rel");

            $('#' + id).show();
            obj.addClass("selected");
        }

    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <div class="divmain" style="width: 100%;">
            <acc:heading ID="pagehead" runat="server" HeadingText="Purchase Receive" />
        </div>
        <div style="margin-left: 2%; width: 100%">
            <asp:Label ID="lblMsg" runat="server" Font-Bold="true"></asp:Label>
        </div>
        <div style="width: 100%; border: 1px solid black; margin-left: 2%; margin-top: 10px">
            <table class="tablecontent" style="border:1px solid black; width: 100%">
                <tr>
                    <td class="headtd" colspan="4">
                        Purchase Invoice Details
                        <asp:HiddenField ID="hidBillformatId" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        P.O. Number
                    </td>
                    <td>
                        <asp:HyperLink ID="hyperPoNumber" runat="server" NavigateUrl="#">
                            <asp:Label ID="lblPONumber" runat="server"></asp:Label></asp:HyperLink>
                    </td>
                    <td>
                        Supplier
                    </td>
                    <td>
                        <asp:Label ID="lblSupplier" runat="server"></asp:Label>
                        <asp:HiddenField ID="hidSupplierID" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Voucher No.<span style="color: Red">*</span>
                    </td>
                    <td>
                        <asp:TextBox ID="txtPrefix" runat="server" Width="70px" CssClass="input" onKeyPress="return false"
                            onKeydown="return false"></asp:TextBox>
                        <AjaxControl:TextBoxWatermarkExtender ID="prefixWater" runat="server" TargetControlID="txtPrefix"
                            WatermarkText="Prefix" WatermarkCssClass="watermark_textbox">
                        </AjaxControl:TextBoxWatermarkExtender>
                        <asp:TextBox ID="txtVoucher" runat="server" Width="70px" CssClass="inputnumber" ValidationGroup="V"
                            MaxLength="10"></asp:TextBox>
                        <AjaxControl:TextBoxWatermarkExtender ID="voucherWater" runat="server" TargetControlID="txtVoucher"
                            WatermarkText="Number" WatermarkCssClass="watermark_textbox">
                        </AjaxControl:TextBoxWatermarkExtender>
                        <asp:TextBox ID="txtSuffix" runat="server" Width="70px" CssClass="input" onKeyPress="return false"
                            onKeydown="return false"></asp:TextBox>
                        <AjaxControl:TextBoxWatermarkExtender ID="suffixWater" runat="server" TargetControlID="txtSuffix"
                            WatermarkText="Suffix" WatermarkCssClass="watermark_textbox">
                        </AjaxControl:TextBoxWatermarkExtender>
                    </td>
                    <td>
                        Invoice No.<span style="color: Red">*</span>
                    </td>
                    <td>
                        <asp:TextBox ID="txtInvoiceNo" runat="server" CssClass="input"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="reqInvoiceNo" runat="server" ControlToValidate="txtInvoiceNo"
                            ValidationGroup="V" SetFocusOnError="true" Display="Dynamic" ErrorMessage="*"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        Date<span style="color: Red">*</span>
                    </td>
                    <td>
                        <asp:TextBox ID="txtDate" runat="server" Width="120px" CssClass="input" ValidationGroup="V"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="reqDate" runat="server" ControlToValidate="txtDate"
                            ValidationGroup="V" SetFocusOnError="true" Display="Dynamic" ErrorMessage="*"></asp:RequiredFieldValidator>&nbsp;
                        <asp:ImageButton ID="btnDate" runat="server" ImageUrl="~/Images/calendar.gif" />
                        <AjaxControl:CalendarExtender ID="cal" runat="server" PopupButtonID="btnDate" TargetControlID="txtDate"
                            Format="dd/MM/yyyy">
                        </AjaxControl:CalendarExtender>
                        <AjaxControl:MaskedEditExtender ID="maskExt" runat="server" MaskType="Date" Mask="99/99/9999"
                            TargetControlID="txtDate" CultureName="pt-BR">
                        </AjaxControl:MaskedEditExtender>
                        <AjaxControl:MaskedEditValidator ID="maskValid" runat="server" ControlExtender="maskExt"
                            InvalidValueMessage="Invalid Date" IsValidEmpty="true" Display="Dynamic" ValidationGroup="V"
                            ControlToValidate="txtDate"></AjaxControl:MaskedEditValidator>
                    </td>
                    <td>
                        Tax Group<span style="color: Red">*</span>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlTaxGroup" runat="server" AutoPostBack="true" CssClass="dropdown"
                            OnSelectedIndexChanged="ddlTaxGroup_SelectedIndexChanged">
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="reqTaxGroup" runat="server" InitialValue="0" SetFocusOnError="true"
                            ControlToValidate="ddlTaxGroup" ValidationGroup="V" Display="Dynamic" ErrorMessage="*"></asp:RequiredFieldValidator>&nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        Bill Reference.
                    </td>
                    <td>
                        <asp:TextBox ID="txtBillRef1" runat="server" Width="90px" CssClass="input" ValidationGroup="V"
                            MaxLength="20"></asp:TextBox>
                        <asp:TextBox ID="txtBillRef2" runat="server" Width="80px" CssClass="input" ValidationGroup="V"></asp:TextBox>
                        <AjaxControl:CalendarExtender ID="extCalbill" runat="server" Format="dd/MM/yyyy"
                            TargetControlID="txtBillRef2">
                        </AjaxControl:CalendarExtender>
                        <AjaxControl:MaskedEditExtender ID="maskRefDate" runat="server" Mask="99/99/9999"
                            TargetControlID="txtBillRef2" MaskType="Date" CultureName="en-GB">
                        </AjaxControl:MaskedEditExtender>
                        <AjaxControl:MaskedEditValidator ID="maskValidRef" runat="server" ControlExtender="maskRefDate"
                            ControlToValidate="txtBillRef2" ValidationGroup="V" InvalidValueMessage="*"></AjaxControl:MaskedEditValidator>
                    </td>
                    <td>
                    </td>
                    <td>
                        <div style="float: left;">
                            <asp:RadioButtonList ID="rbtCashCredit" runat="server" RepeatDirection="Horizontal">
                                <asp:ListItem Value="1" Text="Cash&nbsp;" Selected="True"></asp:ListItem>
                                <asp:ListItem Value="2" Text="Credit"></asp:ListItem>
                            </asp:RadioButtonList>
                        </div>
                        <div style="float: left; margin-left: 2px">
                            <asp:TextBox ID="txtCreditDay" runat="server" onKeyPress="return isNumberKey(this.id,event)"
                                Width="30px" CssClass="inputnumber" onblur="CreditDays()" MaxLength="3"></asp:TextBox>
                            &nbsp;Days
                        </div>
                    </td>
                </tr>
            </table>
        </div>
        <div id="wrapper">
            <ul class="tabs">
                <li><a href="javascript:void(0)" class="defaulttab" rel="tabGeneral">General</a></li>
                <li><a href="javascript:void(0)" rel="tabOther">Other</a></li>
            </ul>
            <div class="tab-content" id="tabGeneral" runat="server" style="width: 100%">
                <%--<asp:UpdatePanel ID="UpdatePanel2"  runat="server">                     
            <ContentTemplate>    --%>
                <div style="width: 100%">
                    <asp:HiddenField ID="hidControlTblItems" Value="0" runat="server" />
                    <div style="border: 1px solid #818181; width: 100%;">
                        <table id="tblTaxBillLevel" runat="server" style="width: 100%;" cellpadding="2" cellspacing="0">
                            <tr>
                                <td style="width: 20%; border-right: 1px solid #818181; border-bottom: 1px solid #818181;
                                    text-align: center; font-weight: bold" class="headtd">
                                    Item(s)
                                </td>
                                <td style="width: 15%; border-right: 1px solid #818181; border-bottom: 1px solid #818181;
                                    text-align: center; font-weight: bold" class="headtd">
                                    Unit
                                </td>
                                <td style="width: 15%; border-bottom: 1px solid #818181; text-align: center; font-weight: bold"
                                    class="headtd">
                                    Received Qty
                                </td>
                                <td style="width: 10px; border-right: 1px solid #818181; border-bottom: 1px solid #818181;"
                                    class="headtd">
                                    &nbsp;
                                </td>
                                <td style="width: 15%; border-right: 1px solid #818181; border-bottom: 1px solid #818181;
                                    text-align: center; font-weight: bold" class="headtd">
                                    Rate
                                </td>
                                <td style="width: 17%; border-right: 1px solid #818181; border-bottom: 1px solid #818181;
                                    text-align: center; font-weight: bold" class="headtd">
                                    Gross Amount
                                </td>
                                <td style="width: 18%; border-bottom: 1px solid #818181; text-align: center; font-weight: bold"
                                    class="headtd">
                                    Amount Payable
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div style="width: 100%;">
                    <div style="width: 40%; float: left; margin-right: 8%">
                        <table style="width: 100%; margin-top: 3px;">
                            <tr>
                                <td>
                                    Purchase Ledger<span style="color: Red">*</span>
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlPurchaseLedger" runat="server" CssClass="dropdown">
                                    </asp:DropDownList>
                                    <asp:RequiredFieldValidator ID="reqPurchaseLedger" runat="server" ControlToValidate="ddlPurchaseLedger"
                                        SetFocusOnError="true" ValidationGroup="V" InitialValue="0" Display="Dynamic"
                                        ErrorMessage="*"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Tax Ledger
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlTaxLedger" runat="server" CssClass="dropdown" Enabled="false">
                                    </asp:DropDownList>
                                    <asp:RequiredFieldValidator ID="reqTaxLedger" runat="server" ControlToValidate="ddlTaxLedger"
                                        InitialValue="0" SetFocusOnError="true" ValidationGroup="V" Enabled="false" Display="Dynamic"
                                        ErrorMessage="*"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div style="width: 50%; float: right">
                        <table style="width: 98%;" align="right">
                            <tr>
                                <td style="width: 70%">
                                    Total Item Quantity
                                </td>
                                <td style="width: 30%">
                                    <asp:TextBox ID="txtTotalQuantity" runat="server" CssClass="inputnumber" onkeydown="return CatchTab(this.id,event)"
                                        AutoCompleteType="Disabled" Text="0.00"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Total Gross Amount
                                </td>
                                <td>
                                    <asp:TextBox ID="txtGrossAmount" runat="server" CssClass="inputnumber" onkeydown="return CatchTab(this.id,event)"
                                        AutoCompleteType="Disabled" Text="0.00"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Taxable Amount
                                </td>
                                <td>
                                    <asp:TextBox ID="txtTaxableAmt" runat="server" CssClass="inputnumber" onkeydown="return CatchTab(this.id,event)"
                                        AutoCompleteType="Disabled" Text="0.00"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    VAT/CST &nbsp;<asp:DropDownList ID="ddlVat" Width="200px" runat="server" onclick="return checkTaxGroup(this.id)"
                                        AutoPostBack="true" OnSelectedIndexChanged="ddlVat_SelectedIndexChanged" CssClass="dropdown">
                                    </asp:DropDownList>
                                    <asp:HiddenField ID="hidTaxRate" runat="server" />
                                </td>
                                <td>
                                    <asp:TextBox ID="txtVat" runat="server" CssClass="inputnumber" onkeydown="return CatchTab(this.id,event)"
                                        AutoCompleteType="Disabled" Text="0.00"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Post Tax Total
                                </td>
                                <td>
                                    <asp:TextBox ID="txtPostTaxTotal" runat="server" CssClass="inputnumber" onkeydown="return CatchTab(this.id,event)"
                                        Text="0.00" AutoCompleteType="Disabled"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Round off Amount&nbsp;<asp:DropDownList ID="ddlRoundOff" runat="server" Width="80px"
                                        CssClass="dropdown">
                                    </asp:DropDownList>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtRoundoff" runat="server" CssClass="inputnumber" onKeyPress="return isNumberKey(this.id,event)"
                                        AutoCompleteType="Disabled" Text="0.00" onfocus="return RemoveZero(this.id);"
                                        onblur="roundOff(this.id);"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Grand Total
                                </td>
                                <td>
                                    <asp:TextBox ID="txtGrandTotal" runat="server" CssClass="inputnumber" onkeydown="return CatchTab(this.id,event)"
                                        Text="0.00" AutoCompleteType="Disabled"></asp:TextBox>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <%-- </ContentTemplate>    
            </asp:UpdatePanel>--%>
                <div style="clear: both;">
                    &nbsp;</div>
            </div>
            <div class="tab-content" id="tabOther" runat="server">
                <%-- <asp:UpdatePanel ID="UpdatePanel3" runat="server">
                <ContentTemplate> --%>
                <div style="width: 100%">
                    <div style="width: 48%; float: left; margin-right: 4%">
                        <table style="width: 100%">
                            <tr>
                                <td style="width: 30%">
                                    Billing Address
                                </td>
                                <td style="width: 70%">
                                    <asp:TextBox ID="txtBillAddress" runat="server" TextMode="MultiLine" CssClass="input"
                                        Width="97%" Height="60px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 30%">
                                    Delivery Address
                                </td>
                                <td style="width: 70%">
                                    <asp:TextBox ID="txtDeliveryAdd" runat="server" TextMode="MultiLine" CssClass="input"
                                        Width="97%" Height="60px"></asp:TextBox>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div style="width: 48%; float: left;">
                        <table style="width: 100%">
                            <tr>
                                <td style="width: 40%">
                                    Mode of Delivery
                                </td>
                                <td style="width: 60%">
                                    <asp:TextBox ID="txtDeliveryMode" runat="server" Width="97%" CssClass="input"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 40%">
                                    Delivery Date
                                </td>
                                <td style="width: 60%">
                                    <asp:TextBox ID="txtDeliveryDate" runat="server" Width="97%" CssClass="input" ValidationGroup="V"></asp:TextBox>
                                    <AjaxControl:CalendarExtender ID="extCal2" runat="server" TargetControlID="txtDeliveryDate"
                                        Format="dd/MM/yyyy">
                                    </AjaxControl:CalendarExtender>
                                    <AjaxControl:MaskedEditExtender ID="maskDeliveryDate" runat="server" TargetControlID="txtDeliveryDate"
                                        MaskType="Date" Mask="99/99/9999" CultureName="en-GB">
                                    </AjaxControl:MaskedEditExtender>
                                    <AjaxControl:MaskedEditValidator ID="maskValidDelivery" InvalidValueMessage="Invalid Date"
                                        runat="server" ControlToValidate="txtDeliveryDate" ControlExtender="maskDeliveryDate"
                                        IsValidEmpty="true" ValidationGroup="V"></AjaxControl:MaskedEditValidator>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 40%">
                                    Document NO.
                                </td>
                                <td style="width: 60%">
                                    <asp:TextBox ID="txtDocumentNo" runat="server" Width="97%" CssClass="input"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 40%">
                                    Transporter Name
                                </td>
                                <td style="width: 60%">
                                    <asp:TextBox ID="txtTransporter" runat="server" Width="97%" CssClass="input"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 40%">
                                    Vehicle Number
                                </td>
                                <td style="width: 60%">
                                    <asp:TextBox ID="txtVehicle" runat="server" Width="97%" CssClass="input"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 40%">
                                    <asp:Label ID="lblSalePerson" runat="server"></asp:Label>
                                </td>
                                <td style="width: 60%">
                                    <asp:TextBox ID="txtSalesPerson" runat="server" Width="97%" CssClass="input"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 40%">
                                    Prepared By
                                </td>
                                <td style="width: 60%">
                                    <asp:TextBox ID="txtPreparedBy" runat="server" Width="97%" CssClass="input"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 40%">
                                    Checked By
                                </td>
                                <td style="width: 60%">
                                    <asp:TextBox ID="txtCheckedBy" runat="server" Width="97%" CssClass="input"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 40%">
                                    Authorized Signatory
                                </td>
                                <td style="width: 60%">
                                    <asp:TextBox ID="txtSignatory" runat="server" Width="97%" CssClass="input"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 40%">
                                    Narration
                                </td>
                                <td style="width: 60%">
                                    <asp:TextBox ID="txtNarration" runat="server" Width="97%" CssClass="input"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 40%">
                                    Remarks
                                </td>
                                <td style="width: 60%">
                                    <asp:TextBox ID="txtRemark" runat="server" Width="97%" CssClass="input"></asp:TextBox>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <%-- </ContentTemplate>
              </asp:UpdatePanel> --%>
                <div style="clear: both">
                    &nbsp;</div>
            </div>
            <div style="width: 98%">
                <table style="width: 98%; text-align: center">
                    <tr>
                        <td>
                            <asp:Button ID="btnSubmit" Text="Save" runat="server" CssClass="button" OnClientClick="return ValidationInput();"
                                OnClick="btnSubmit_Click" ValidationGroup="V" />
                            &nbsp;
                            <asp:Button ID="btnCancel" Text="Cancel" runat="server" CssClass="button" />
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
    </form>
</body>
</html>
